/**
 * 数据状态
 * @type {[{label: string, value: string},{label: string, value: string}]}
 */
const state = [
    {
        value: false,
        label: '启用',
    },
    {
        value: true,
        label: '禁用',
    },
]
const deviceType = [
    {
        label: '土壤温湿度传感器',
        value: '1',
        key: '1',
        columns: [
            {
                title: '土壤温度',
                dataIndex: 'soilt',
                valueType: 'string',
                hideInSearch: true,
                renderText: (_, record) => record.rowData?.soilt,

            },
            {
                title: '土壤湿度',
                dataIndex: 'soilm',
                valueType: 'string',
                hideInSearch: true,
                renderText: (_, record) => record.rowData?.soilm,
            },
        ]
    },
    {
        label: '风向传感器',
        value: '2',
        key: '2',
        columns: [
            {
                title: '风向',
                dataIndex: 'windd',
                valueType: 'string',
                hideInSearch: true,
                renderText: (_, record) => record.rowData?.windd,
            }
        ]
    },
    {
        label: '风速传感器',
        value: '3',
        key: '3',
        columns: [
            {
                title: '风速',
                dataIndex: 'winds',
                valueType: 'string',
                hideInSearch: true,
                renderText: (_, record) => record.rowData?.winds,
            }
        ]
    },
    {
        label: '光照强度传感器',
        value: '4',
        key: '4',
        columns: [
            {
                title: '光照强度',
                dataIndex: 'lighti',
                valueType: 'string',
                hideInSearch: true,
                renderText: (_, record) => record.rowData?.lighti,
            }
        ]
    }
    ,
    {
        label: '光照有效辐射传感器',
        value: '5',
        key: '5',
        columns: [
            {
                title: '光合有效辐射',
                dataIndex: 'par',
                valueType: 'string',
                hideInSearch: true,
                renderText: (_, record) => record.rowData?.par,
            }
        ]
    }
    ,
    {
        label: '雨量传感器',
        value: '6',
        key: '6',
        columns: [
            {
                title: '雨量',
                dataIndex: 'rainfall',
                valueType: 'string',
                hideInSearch: true,
                renderText: (_, record) => record.rowData?.rainfall,
            }
        ]
    }
    ,
    {
        label: '土壤Ph值传感器',
        value: '7',
        key: '7',
        columns: [
            {
                title: '土壤Ph',
                dataIndex: 'soilph',
                valueType: 'string',
                hideInSearch: true,
                renderText: (_, record) => record.rowData?.soilph,
            }
        ]
    }
    ,
    {
        label: '空气温湿度传感器',
        value: '8',
        key: '8',
        columns: [
            {
                title: '空气温度',
                dataIndex: 'airt',
                valueType: 'string',
                hideInSearch: true,
                renderText: (_, record) => record.rowData?.airt,
            },
            {
                title: '空气湿度',
                dataIndex: 'airm',
                valueType: 'string',
                hideInSearch: true,
                renderText: (_, record) => record.rowData?.airm,
            },
        ]
    }
]
/**
 * 等待时间
 * @param time
 * @returns {Promise<unknown>}
 */
const waitTime = (time = 100) => {
    return new Promise((resolve) => {
        setTimeout(() => {
            resolve(true);
        }, time);
    });
};


/**
 * 分页参数
 * @type {{pageCurr: number, pageSize: number}}
 */
const page = {
    pageCurr: 10,
    pageSize: 1,
}

export {
    waitTime, state, page, deviceType
}
